<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<table width="800px" border="1">
		<tr>
			<th colspan="5">
				<h2>帖子列表</h2>
			</th>
		</tr>
		<tr>
			<th colspan="5">
				<form action="invList">
					帖子标题:<input type="text" name="title"> <input type="submit" value="搜索">
				</form>
			</th>
		</tr>
		<tr>
			<td>标题</td>
			<td>内容</td>
			<td>作者</td>
			<td>发布时间</td>
			<td>操作</td>
		</tr>
		<c:forEach items="${pageInfo.dataList }" var="inv">
		<tr>
			<td>${inv.title }</td>
			<td>${inv.summary }</td>
			<td>${inv.author }</td>
			<td>
				<fmt:formatDate value="${inv.createdate }" pattern="yyyy-MM-dd"/>
			</td>
			<td>
				<a href="replyList?invid=${inv.id }">查看回复</a>
				<a href="delete?id=${inv.id }" class="del">删除</a>
			</td>
		</tr>
		</c:forEach>
	</table>
	<div>
		第${pageInfo.currPageNo }/${pageInfo.totalPageCount }页
		
		
	</div>
	<script type="text/javascript" src="/InvitationManage/statics/jquery.min.js"></script>
	<script type="text/javascript">
		$(function(){
			$(".del").click(function(){
				var that = $(this);
				$.get(that.attr("href"),"",function(f){
					$("table").append("<tr><th colspan='5'>"+(f?"删除成功":"删除失败")+"</th></tr>");
				})
				return false;
			})
		})
	
	</script>
	
</body>
</html>